package com.panshi.controller;

import com.panshi.service.CollectionService;
import com.panshi.util.CommonResult;
import com.panshi.util.TimeVO;
import com.panshi.vo.CollectionVO;
import com.panshi.vo.PageSizeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController
@Slf4j
@CrossOrigin
public class CollectionController {

    @Autowired
    private CollectionService collectionService;

    @PostMapping("/collQy")
    public List<CollectionVO> findCoQuery(@RequestBody PageSizeVO pageSizeVO){
        System.out.println(pageSizeVO.getUid());
        return collectionService.findCoQuery(pageSizeVO);
    }

    @GetMapping("/collDe/{cid}")
    public CommonResult<String> deleteCo(@PathVariable int cid){
        log.info("删除删除");
        collectionService.deleteCo(cid);
        return new CommonResult<String>();
    }

}
